from elasticsearch_dsl import (
    DocType,
    String,
    MetaField,
    analyzer
)


lowercase_keyword = analyzer(
    'lowercase_keyword',
    tokenizer="keyword",
    filter=["lowercase"]
)


class Images(DocType):
    class Meta:
        index = "images"
        doc_type = "images"
        dynamic = MetaField('strict')
        all = MetaField(enabled=False)

    categories = String(norms={'enabled': False})
    tags = String(norms={'enabled': False})
    descriptions = String()
    names = String(norms={'enabled': False})
    filename = String(index='not_analyzed')
